1. Field of the Invention
The invention relates to multimedia processing device, and in particular to a method for removing blocking artifacts in block-based signals.
2. Description of the Related Art
Encoder and decoder are used for digital compression and decompression of multimedia data (e.g., according to Joint Photographic Experts Group (JPEG) or Moving Picture Expert Group (MPEG) industry standard data). However, when used at relatively low bit rates, the output of the decoder module produces noticeable coding artifacts, such as blockiness and ringing. Both types of artifacts are undesirable and caused by attenuation of high frequency terms. With blockiness artifacts, the boundaries of coded blocks are visible in slow-varying regions in image or video frames. Accordingly, there is a need to reduce blocking artifacts, particularly in MPEG encoded video streams, still-images, video conferencing applications, and other transform-based codecs.
It should be noted that the blocking artifacts appear at the block boundary between fixed block patterns in the form of a line of discontinuity, and removal of the blocking artifacts involves transformation of discontinuity to continuity in the block boundary region.
MPEG4 has defined a method for removing blocking artifacts in a coding system of a moving picture defined in ISO/IEC14996-2 F.3. The suggested number of pixels around a block boundary by MPEG4 is ten pixels (e.g., v0-v9). A mode decision value (e.g., eq_cnt) is calculated according to the following condition:eq—cnt=φ(v0−v1)+φ(v1−v2)+φ(v2−v3)+φ(v3−v4)+φ(v4−v5)+φ(v5−v6)+φ(v6−v7)+φ(v7−v8)+φ(v8−v9)
where φ(r)=1, if |r|≦THR1, otherwise φ(r)=0, and the THR1 is a first threshold value.
The mode decision value is used to determine whether to use the default mode or to use the DC offset mode for deblocking operations. The DC offset mode is selected if the mode decision value is greater than or equal to a second threshold value (e.g., THR2), otherwise the default mode is selected. When the default mode is selected, the deblocking operation is performed by replacing the magnitude of the discontinuous component of pixel v4 and v5 sandwiching the block boundary with v4′ and v5′, according to the following equation:v4′=v4−d v5′=v5+d d=CLIP(c2·(a3,0′−a3,0)//c3,(v4−v5)2)*δ(|a3,0|<QP a3,0′=SIGN(a3,0)*MIN(|a3,0|,|a3,1|,|a3,2|))a3,0=([c1−c2c2−c1]*[v3v4v5v6]T)//c3 a3,1=([c1−c2c2−c1]*[v1v2v3v4]T)//c3 a3,2=([c1−c2c2−c1]*[v5v6v7v8]T)//c3 wherein QP is the quantization parameter of a macroblock where pixel v5 belongs, values c1, c2, c3 are kernel constants used in 4-point DCT, and a3,0, a3,1, a3,2 are the discontinuous component in each of the plurality of pixel sets (S0, S1, S2), respectively.
When the DC offset mode is selected, the equation to remove the blocking artifacts is as follow:
            max      =              MAX        ⁡                  (                                    v              1                        ,                          v              2                        ,                          v              3                        ,                          v              4                        ,                          v              5                        ,                          v              6                        ,                          v              7                        ,                          v              8                                )                      ,                  ⁢          min      =              MIN        ⁡                  (                                    v              1                        ,                          v              2                        ,                          v              3                        ,                          v              4                        ,                          v              5                        ,                          v              6                        ,                          v              7                        ,                          v              8                                )                      ,                  ⁢                  if        ⁢                                  ⁢                                        max            -            min                                        <              2        ·        QP              ,                  ⁢                  then        ⁢                                  ⁢                  v          n          ′                    =                        ∑                      k            =                          -              4                                4                ⁢                              b            k                    ·                      p                          n              +              k                                            ,          1      ≤      n      ≤      8                  p      m        =          {                                                                                                                                                      (                                                                                                                                                                        v                                1                                                            -                                                              v                                0                                                                                                                                          <                          QP                                                )                                            ?                                              v                        0                                                              ⁢                                          :                                        ⁢                                          v                      1                                                        ,                                      m                    <                    1                                                                                                                                            v                    m                                    ,                                      1                    ≤                    m                    ≤                    8                                                                                                                                                                                          (                                                                                                                                                                        v                                8                                                            -                                                              v                                9                                                                                                                                          <                          QP                                                )                                            ?                                              v                        9                                                              ⁢                                          :                                        ⁢                                          v                      8                                                        ,                                      m                    >                    8                                                                                ⁢                                          ⁢                      {                                                                                b                    k                                    ⁢                                      :                                                  ⁢                                                                  -                4                            ≤              k              ≤              4                        }                          =                              {                          1              ,              1              ,              2              ,              2              ,              4              ,              2              ,              2              ,              1              ,              1                        }                    //          16                    wherein the v0-v9 are boundary pixels, QP is the quantization parameter of a block adjacent the block boundary, and vn is an adjusted value. The equation (|v1−v0|<QP)?v0:v1 means Pm=v0 when (|v1−v0|<QP), while Pm=v1 when (|v1−v0|≧QP). The equation (|v8−v9|<QP)?v9: v8 means Pm=v9 when (|v8−v9|<QP), while Pm=v8 when (|v8−v9|≧QP).
The deblocking operation is performed by replacing v1-v8 with v1′-v8′. The blockiness artifact in the image or video frame will be removed after performing the deblocking operation through the default mode or DC offset mode.
Since ten pixels around the block boundary are taken into consideration, a 40 bit width is needed for a deblocking operation. In present systems with 32 bit bus/memory width, two memory accesses are required for a deblocking operation. Thus, the bandwidth request is increased.